package com.enjoyor.soa.traffic.rest.efoms.dubbo.impl;

import com.alibaba.dubbo.config.annotation.Reference;
import com.enjoyor.soa.traffic.api.service.dubbo.efoms.IDubboFacilitySimpleInfoService;
import com.enjoyor.soa.traffic.rest.efoms.dubbo.IFacilitySimpleInfoConsumeService;
import com.enjoyor.soa.traffic.util.enums.EnumAppCode;
import com.enjoyor.soa.traffic.util.helper.ResultHelper;
import com.enjoyor.soa.traffic.util.pojo.Page;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;

import org.springframework.stereotype.Component;

@Component
public class FacilitySimpleInfoConsumeService implements IFacilitySimpleInfoConsumeService {

    @Reference(version = "1.0.0", timeout = 10000)
    private IDubboFacilitySimpleInfoService dubboFacilitySimpleService;
    
    /**
     * 根据编号查询设施信息
     * @param facilityTypeCode 设施类型编号
     * @param facilityId 设施编号
     * @return ResultPojo
     */
    @Override
	public ResultPojo selectFacilitySimpleInfoById(String facilityTypeCode, String facilityId) {
    	ResultPojo resultPojo = new ResultPojo();
        try {
			resultPojo = dubboFacilitySimpleService.selectFacilitySimpleInfoById(facilityTypeCode, facilityId);
        }catch (Exception e ){
            e.printStackTrace();
            return ResultHelper.getResult(e,EnumAppCode.OPERATOR_FAILURE);
        }
        return resultPojo;
    }
    
    /**
     * 查询设施列表信息
     * @param facilityTypeCode 设施类型编号
     * @param facilityId 设施编号
     * @param facilityName 设施名称
     * @param key 关键字（设施编号或设施名称）
     * @param devStatusCode 设施状态编号
     * @param regionId 管辖区域编号
     * @param signsType 设施子类编号
     * @param signsCode 设施小类编号
     * @param roadId 道路编号
     * @param blockId 路段编号
     * @param crossId 路口编号
     * @param manageDept 管理部门编号
     * @param manufact 生成厂家
     * @param repStatusCode 报修状态编号
     * @param buildBeginDate 建设开始日期
     * @param buildEndDate 建设结束日期
     * @param updateBeginTime 更新开始日期
     * @param updateEndTime 更新结束日期
     * @return ResultPojo
     */
    @Override
    public ResultPojo selectFacilitySimpleInfoList(String facilityTypeCode, String facilityId,
			String facilityName, String key, String devStatusCode, String regionId, String signsType, String signsCode,
			String roadId, String blockId, String crossId, String manageDept, String manufact, String repStatusCode,
			String buildBeginDate, String buildEndDate, String updateBeginTime, String updateEndTime,String deviceStatus) {
    	ResultPojo resultPojo = new ResultPojo();
        try {
			resultPojo = dubboFacilitySimpleService.selectFacilitySimpleInfoList(facilityTypeCode, facilityId,
					facilityName, key, devStatusCode, regionId, signsType, signsCode, roadId, blockId, crossId,
					manageDept, manufact, repStatusCode, buildBeginDate, buildEndDate, updateBeginTime, updateEndTime,deviceStatus);
		}catch (Exception e ){
            e.printStackTrace();
            return ResultHelper.getResult(e,EnumAppCode.OPERATOR_FAILURE);
        }
        return resultPojo;
    }
    /**
     * 设施分页查询信息（资产管理）
     * @param facilityTypeCode 设施类型编号
     * @param facilityId 设施编号
     * @param facilityName 设施名称
     * @param key 关键字（设施编号或设施名称）
     * @param devStatusCode 设施状态编号
     * @param regionId 管辖区域编号
     * @param signsType 设施子类编号
     * @param signsCode 设施小类编号
     * @param roadId 道路编号
     * @param blockId 路段编号
     * @param crossId 路口编号
     * @param manageDept 管理部门编号
     * @param manufact 生成厂家
     * @param repStatusCode 报修状态编号
     * @param buildBeginDate 建设开始日期
     * @param buildEndDate 建设结束日期
     * @param updateBeginTime 质保到期开始日期
     * @param updateEndTime 质保到期结束日期
     * @return ResultPojo
     */
    @Override
	@SuppressWarnings("rawtypes")
    public ResultPojo selectFacilitySimpleInfoPage(String facilityTypeCode, String facilityId, String facilityName, String key,
			String devStatusCode, String regionId, String signsType, String signsCode, String roadId, String blockId,
			String crossId, String manageDept, String manufact, String repStatusCode, String buildBeginDate,
			String buildEndDate, String updateBeginTime, String updateEndTime,String deviceStatus, Page page) {
    	ResultPojo resultPojo = new ResultPojo();
        try {
			resultPojo = dubboFacilitySimpleService.selectFacilitySimpleInfoPage(facilityTypeCode, facilityId,
					facilityName, key, devStatusCode, regionId, signsType, signsCode, roadId, blockId, crossId,
					manageDept, manufact, repStatusCode, buildBeginDate, buildEndDate, updateBeginTime, updateEndTime,deviceStatus,
					page);
		}catch (Exception e ){
            e.printStackTrace();
            return ResultHelper.getResult(e,EnumAppCode.OPERATOR_FAILURE);
        }
        return resultPojo;
    }

}
